package com.smartcampusbackend.service.impl;

import com.smartcampusbackend.mapper.MajorMapper;
import com.smartcampusbackend.model.Major;
import com.smartcampusbackend.service.MajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class MajorServiceImpl implements MajorService {
    
    @Autowired
    private MajorMapper majorMapper;
    
    @Override
    public List<Major> listAllMajors() {
        return majorMapper.selectList(null);
    }
    
    @Override
    public Major getMajorById(Long id) {
        return majorMapper.selectById(id);
    }
    
    @Override
    public List<Major> listMajorsByDepartment(Long departmentId) {
        return majorMapper.selectByDepartmentId(departmentId);
    }
} 